Optimal. Leaf size=82 \[ -\frac {\left (2 a^2+3 b^2\right ) \cot (e+f x)}{3 f}-\frac {a^2 \cot (e+f x) \csc ^2(e+f x)}{3 f}-\frac {a b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {a b \cot (e+f x) \csc (e+f x)}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.09, antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {2789, 3768, 3770, 3012, 3767, 8} \[ -\frac {\left (2 a^2+3 b^2\right ) \cot (e+f x)}{3 f}-\frac {a^2 \cot (e+f x) \csc ^2(e+f x)}{3 f}-\frac {a b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {a b \cot (e+f x) \csc (e+f x)}{f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2789
Rule 3012
Rule 3767
Rule 3768
Rule 3770
Rubi steps
\begin {align*} \int \csc ^4(e+f x) (a+b \sin (e+f x))^2 \, dx &=(2 a b) \int \csc ^3(e+f x) \, dx+\int \csc ^4(e+f x) \left (a^2+b^2 \sin ^2(e+f x)\right ) \, dx\\ &=-\frac {a b \cot (e+f x) \csc (e+f x)}{f}-\frac {a^2 \cot (e+f x) \csc ^2(e+f x)}{3 f}+(a b) \int \csc (e+f x) \, dx+\frac {1}{3} \left (2 a^2+3 b^2\right ) \int \csc ^2(e+f x) \, dx\\ &=-\frac {a b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {a b \cot (e+f x) \csc (e+f x)}{f}-\frac {a^2 \cot (e+f x) \csc ^2(e+f x)}{3 f}-\frac {\left (2 a^2+3 b^2\right ) \operatorname {Subst}(\int 1 \, dx,x,\cot (e+f x))}{3 f}\\ &=-\frac {a b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {\left (2 a^2+3 b^2\right ) \cot (e+f x)}{3 f}-\frac {a b \cot (e+f x) \csc (e+f x)}{f}-\frac {a^2 \cot (e+f x) \csc ^2(e+f x)}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.04, size = 132, normalized size = 1.61 \[ -\frac {2 a^2 \cot (e+f x)}{3 f}-\frac {a^2 \cot (e+f x) \csc ^2(e+f x)}{3 f}-\frac {a b \csc ^2\left (\frac {1}{2} (e+f x)\right )}{4 f}+\frac {a b \sec ^2\left (\frac {1}{2} (e+f x)\right )}{4 f}+\frac {a b \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{f}-\frac {a b \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{f}-\frac {b^2 \cot (e+f x)}{f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.52, size = 149, normalized size = 1.82 \[ -\frac {2 \, {\left (2 \, a^{2} + 3 \, b^{2}\right )} \cos \left (f x + e\right )^{3} - 6 \, a b \cos \left (f x + e\right ) \sin \left (f x + e\right ) + 3 \, {\left (a b \cos \left (f x + e\right )^{2} - a b\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) \sin \left (f x + e\right ) - 3 \, {\left (a b \cos \left (f x + e\right )^{2} - a b\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) \sin \left (f x + e\right ) - 6 \, {\left (a^{2} + b^{2}\right )} \cos \left (f x + e\right )}{6 \, {\left (f \cos \left (f x + e\right )^{2} - f\right )} \sin \left (f x + e\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.40, size = 93, normalized size = 1.13 \[ -\frac {2 a^{2} \cot \left (f x +e \right )}{3 f}-\frac {a^{2} \cot \left (f x +e \right ) \left (\csc ^{2}\left (f x +e \right )\right )}{3 f}-\frac {a b \cot \left (f x +e \right ) \csc \left (f x +e \right )}{f}+\frac {a b \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{f}-\frac {b^{2} \cot \left (f x +e \right )}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.69, size = 89, normalized size = 1.09 \[ \frac {3 \, a b {\left (\frac {2 \, \cos \left (f x + e\right )}{\cos \left (f x + e\right )^{2} - 1} - \log \left (\cos \left (f x + e\right ) + 1\right ) + \log \left (\cos \left (f x + e\right ) - 1\right )\right )} - \frac {6 \, b^{2}}{\tan \left (f x + e\right )} - \frac {2 \, {\left (3 \, \tan \left (f x + e\right )^{2} + 1\right )} a^{2}}{\tan \left (f x + e\right )^{3}}}{6 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.78, size = 136, normalized size = 1.66 \[ \frac {a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3}{24\,f}+\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (\frac {3\,a^2}{8}+\frac {b^2}{2}\right )}{f}-\frac {{\mathrm {cot}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (3\,a^2+4\,b^2\right )+\frac {a^2}{3}+2\,a\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{8\,f}+\frac {a\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2}{4\,f}+\frac {a\,b\,\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sin {\left (e + f x \right )}\right )^{2} \csc ^{4}{\left (e + f x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________